/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 *
 * @author edd
 */
@Entity(name = "SalesInquiry")
public class SalesInquiryEntity extends DataObjectEntity implements Serializable {

    @ManyToOne
    private SalesLeadEntity salesLead;
    @ManyToOne
    private SystemUserEntity systemUser;
    @ManyToOne
    private CustomerEntity customer;
    @OneToMany(cascade={CascadeType.PERSIST}, mappedBy="salesInquiry")
    private Collection<ProductQuantityPriceEntity> pqp = new ArrayList<ProductQuantityPriceEntity>();
    private boolean converted;
    private double totalPrice;
    
    public SalesInquiryEntity() {
        super();
        setConverted(false);
    }
    
    public SalesLeadEntity getSalesLead() {
        return salesLead;
    }

    public void setSalesLead(SalesLeadEntity salesLead) {
        this.salesLead = salesLead;
    }

    public CustomerEntity getCustomer() {
        return customer;
    }

    public void setCustomer(CustomerEntity customer) {
        this.customer = customer;
    }

    public Collection<ProductQuantityPriceEntity> getPqp() {
        return pqp;
    }

    public void setPqp(Collection<ProductQuantityPriceEntity> pqp) {
        this.pqp = pqp;
    }

    public SystemUserEntity getSystemUser() {
        return systemUser;
    }

    public void setSystemUser(SystemUserEntity systemUser) {
        this.systemUser = systemUser;
    }

    public boolean isConverted() {
        return converted;
    }

    public void setConverted(boolean converted) {
        this.converted = converted;
    }

    @Override
    public String childToString() {
        return "SalesInquiryEntity{" + "salesLead=" + salesLead + ", systemUser=" + systemUser + ", customer=" + customer + ", pqp=" + pqp + ", converted=" + converted + '}';
    }

    public double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(double totalPrice) {
        this.totalPrice = totalPrice;
    }

    
}
